Introduce Thymeleaf fragments and dynamic case management features#22
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 6 minutes and 24 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThe PR implements full-stack case management: JPA now auto-generates UUIDs for case IDs, the UI controller integrates with CaseService for CRUD operations, and templates transition from static placeholders to dynamic Thymeleaf rendering displaying actual case data. A shared head fragment consolidates common template structure and styling. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@src/main/java/org/example/projektarendehantering/presentation/web/UiController.java`:
- Around line 34-43: Replace direct binding of CaseDTO in UiController.newCase
and UiController.createCase with a new CreateCaseForm DTO that exposes only
title and description; update the GET to model.addAttribute("createCaseForm",
new CreateCaseForm()) and the POST to accept `@Valid`
`@ModelAttribute`("createCaseForm") CreateCaseForm form, then construct a new
CaseDTO inside createCase copying only title/description (do not accept
id/status/createdAt from the client) and pass that CaseDTO to
caseService.createCase(); also add CreateCaseForm with validation annotations
and update templates/cases/new.html th:object to use createCaseForm. Ensure
CaseMapper.toEntity and CaseService.createCase remain unchanged so only
server-generated fields are set server-side.
In `@src/main/resources/templates/fragments/head.html`:
- Around line 123-131: The CSS removes the keyboard focus indicator by using
"outline: none" on the .input selector; restore an accessible focus cue by
removing the global outline suppression and adding a visible focus style for
.input:focus (e.g., a high-contrast outline or box-shadow using your theme
variables like --focus or --border) so keyboard users get a clear, persistent
focus ring; update the .input rule and add a .input:focus rule (or
:focus-visible) to provide a clear, high-contrast indicator that matches your
design system.
- Around line 3-6: The head fragment uses ${title} but callers discard child
nodes so pages fall back to "Ärendehantering"; update every caller (index.html,
cases/list.html, cases/detail.html, cases/new.html) to pass the page title
explicitly via the fragment parameter (use the head fragment name "head" and
supply the title, e.g. th:replace="~{fragments/head :: head('Cases')}"), or
alternatively set a "title" model attribute in the corresponding UiController
handlers so ${title} is populated; ensure the fragment invocation and/or
controller model use the exact variable name "title" referenced in the head
fragment.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 72378648-e3b4-4074-921a-5fd044920c90
📒 Files selected for processing (7)
src/main/java/org/example/projektarendehantering/infrastructure/persistence/CaseEntity.javasrc/main/java/org/example/projektarendehantering/presentation/web/UiController.javasrc/main/resources/templates/cases/detail.htmlsrc/main/resources/templates/cases/list.htmlsrc/main/resources/templates/cases/new.htmlsrc/main/resources/templates/fragments/head.htmlsrc/main/resources/templates/index.html
Introduced `CreateCaseForm` DTO with validation annotations for title and description. Updated Thymeleaf templates and controller to align with the new validation structure. Enhanced input error handling and polished UI with dynamic page titles. Removed unnecessary PostgreSQL profile from `docker-compose.yml`.
Summary by CodeRabbit
Release Notes
New Features
Style